{switch name="type"}
    {case value="title"}
        <table class="table table-bordered table-sm">
            <tr>
                <td width="120">是否使用标题图片</td>
                <td>
                    <input type="radio" name="setup[thumb]" value="1" {if condition="$thumb==1"}checked{/if}> 是
                    <input type="radio" name="setup[thumb]" value="0" {if condition="$thumb==0"}checked{/if}> 否
                </td>
            </tr>
            <tr>
                <td>是否使用标题样式</td>
                <td>
                    <input type="radio" name="setup[style]" value="1" {if condition="$style==1"}checked{/if}> 是
                    <input type="radio" name="setup[style]" value="0" {if condition="$style==0"}checked{/if}> 否
                </td>
            </tr>
            <tr>
                <td>文本框长度</td>
                <td>
                    <input type="text" class="form-control" size="5" name="setup[size]" value="{$size}" />
                </td>
            </tr>
        </table>
    {/case}
    {case value="text"}
        <table class="table table-bordered table-sm">
            <tr>
                <td width="120">文本框长度</td>
                <td>
                    <input type="text" class="form-control" size="5" name="setup[size]" value="{$size}" /></td>
            </tr>
            <tr>
                <td>默认值</td>
                <td>
                    <input type="text" class="form-control" size="50" name="setup[default]" value="{$default}" /></td>
            </tr>
            <tr>
                <td>是否为密码框</td>
                <td>
                    <input type="radio" name="setup[ispassword]" value="1" {if condition="$ispassword==1"} checked{/if}> 是
                    <input type="radio" name="setup[ispassword]" value="0" {if condition="$ispassword==0"} checked{/if}> 否
                </td>
            </tr>
            <input type="hidden" id="varchar" name="setup[fieldtype]" value="varchar"/>
        </table>
    {/case}
    {case value="relation"}
        <table  class="">
            <tr>
                <td width="120">内容模型id</td>
                <td><input type="text" class="form-control" size="5" name="setup[modelid]" value="{$modelid}" /></td>
            </tr>
            <input type="hidden" id="varchar" name="setup[fieldtype]" value="varchar"/>
        </table>
    {/case}
    {case value="textarea"}
        <table class="table table-bordered table-condensed">
            <tr>
                <td>字段类型</td>
                <td>
                    <select class="form-control" name="setup[fieldtype]">
                        <option value="text" <?php if($fieldtype=='text') echo 'selected';?>>TEXT</option>
                        <option value="mediumtext" <?php if($fieldtype=='mediumtext') echo 'selected';?>>MEDIUMTEXT</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td width="120">文本域行数</td>
                <td>
                    <input type="text" class="form-control" size="5" name="setup[rows]" value="{$rows}" />
                </td>
            </tr>
            <tr>
                <td>文本域列数</td>
                <td>
                    <input type="text" class="form-control" size="5" name="setup[cols]" value="{$cols}" />
                </td>
            </tr>
            <tr>
                <td>默认值</td>
                <td>
                    <textarea class="form-control" name="setup[default]" rows="3" cols="40">{$default}</textarea>
                </td>
            </tr>
        </table>
    {/case}
    {case value="select"}
        <table class="table table-bordered table-sm">
            <tr>
                <td width="120">选项列表:<br>例: <font color="red">选项名称|值</font></td>
                <td>
                    <textarea class="form-control" name="setup[options]" rows="5" cols="40">{if condition="strlen($options)!=5"}{$options}{/if}</textarea>
                </td>
            </tr>
            <tr>
                <td>选项类型</td>
                <td>
                    <input type="radio" name="setup[multiple]" value="0" {if condition="$multiple==0"} checked{/if}> 下拉框
                    <input type="radio" name="setup[multiple]" value="0" {if condition="$multiple==1"} checked{/if}> 多选列表框
                </td>
            </tr>
            <tr>
                <td>字段类型</td>
                <td>
                    <select name="setup[fieldtype]" class="form-control" onchange="javascript:numbertype(this.value);">
                        <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
                        <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
                        <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
                        <option value="mediumint" <?php if($fieldtype=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option>
                        <option value="int" <?php if($fieldtype=='int') echo 'selected';?>>整数 INT(10)</option>
                    </select>
                    <span id="numbertype" style="display:none;"  > <input type="checkbox" id="" name = "setup[numbertype]" value="1" checked />不包括负数</span>
                </td>
            </tr>
            <tr>
                <td>可见选项的数目</td>
                <td><input type="text" class="form-control" size="5" name="setup[size]" value="{$size}" /></td>
            </tr>
            <tr>
                <td>默认值</td>
                <td> <input type="text" class="form-control" size="5"  name="setup[default]" value="{$default}" /></td>
            </tr>
        </table>

    {/case}
    {case value="datalist"}
    <table class="table">
        <tr>
            <td width="60" valign="top">字段列表</td>
            <td valign="top">
                <textarea  name="setup[cols]" rows="5" cols="40">{if condition="strlen($cols)!=5"}{$cols}{/if}</textarea>
                例: <font color="red">选项名称|字段名称|表单类型</font>
            </td>
        </tr>
        <tr>
            <td>字段类型</td>
            <td>
                <select name="setup[fieldtype]">
                    <option value="mediumtext" <?php if($fieldtype=='mediumtext') echo 'selected';?>>MEDIUMTEXT</option>
                    <option value="text" <?php if($fieldtype=='text') echo 'selected';?>>TEXT</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>默认行数</td>
            <td> <input type="text" class="input-text" size="5"  name="setup[rows]" value="{$rows|default=1}" /></td>
        </tr>
    </table>

{/case}
    {case value="editor"}
        <table class="table table-bordered table-sm">
            <tr>
                <td>编辑器样式：</td>
                <td>
                    <input type="radio" name="setup[toolbar]" value="basic" {if condition="$toolbar=='basic'"} checked{/if}> 简洁型
                    <input type="radio" name="setup[toolbar]" value="full" {if condition="$toolbar=='full'"} checked{/if}> 标准型 </td>
            </tr>
            <tr>
                <td>默认值：</td>
                <td>
                    <textarea name="setup[default]" rows="3" cols="40" id="default"  >{$default}</textarea>
                </td>
            </tr>
            <tr>
                <td>编辑器默认高度：</td>
                <td><input type="text" name="setup[height]" value="{$height}" size="4" class="input-text" ></td>
            </tr>

            <tr>
                <td>显示截取摘要选项：</td>
                <td>
                    <input type="radio" name="setup[show_add_description]" value="1" {if condition="$show_add_description==1"} checked{/if}> 是
                    <input type="radio" name="setup[show_add_description]" value="0" {if condition="$show_add_description==0"} checked{/if}> 否
                </td>
            </tr>

            <tr>
                <td>显示获取标题图片选项：</td>
                <td><input type="radio" name="setup[show_auto_thumb]" value="1" {if condition="$show_auto_thumb==1"} checked{/if}> 是
                    <input type="radio" name="setup[show_auto_thumb]" value="0" {if condition="$show_auto_thumb==0"} checked{/if}> 否
                </td>
            </tr>


            <tr>
                <td>内容是否分页：</td>
                <td><input type="radio" name="setup[showpage]" value="1" {if condition="$showpage==1 || $action_name=='add'"} checked{/if}> 是
                    <input type="radio" name="setup[showpage]" value="0" {if condition="$showpage==0"} checked{/if}> 否</td>
            </tr>
            <tr>
                <td>是否启用关联链接：</td>
                <td><input type="radio" name="setup[enablekeylink]" value="1" {if condition="$enablekeylink==1"} checked{/if}> 是
                    <input type="radio" name="setup[enablekeylink]" value="0" {if condition="$enablekeylink==0"} checked{/if}> 否
                    <input type="text" name="setup[replacenum]" value="{$replacenum}" size="4" class="input-text"> 替换次数 （留空则为替换全部）
                </td>
            </tr>
            <tr>
                <td>是否保存远程图片：</td>
                <td>
                    <input type="radio" name="setup[enablesaveimage]" value="1" {if condition="$enablesaveimage==1"} checked{/if}> 是
                    <input type="radio" name="setup[enablesaveimage]" value="0" {if condition="$enablesaveimage==0"} checked{/if}> 否
                </td>
            </tr>
            <tr>
                <td>是否允许图片上传：</td>
                <td><input type="radio" name="setup[flashupload]" value="1" {if condition="$flashupload==1 || $action_name=='add'"} checked{/if}> 是
                    <input type="radio" name="setup[flashupload]" value="0" {if condition="$flashupload==0"} checked{/if}> 否
                </td>
            </tr>
            <tr>
                <td>允许上传的图片类型：<br>例: <font color="red">jpg,jpeg,gif</font></td>
                <td><input type="text" name="setup[alowuploadexts]" value="{$alowuploadexts}" size="55" class="input-text"></td>
            </tr>
            <tr>
                <td>最多上传图片个数：<br></td>
                <td><input type="text" name="setup[alowuploadlimit]" value="{$alowuploadlimit}" size="35" class="input-text" style="width:40px;">默认为20个</td>
            </tr>
        </table>
    {/case}
    {case value="datetime"}

    {/case}

    {case value="typeid"}
        <table class="table table-bordered table-sm">
            <tr>
                <td width="120">选项类型</td>
                <td>
                    <input type="radio" name="setup[inputtype]" value="checkbox" {if condition="$inputtype=='checkbox'"} checked{/if}> 复选框
                    <input type="radio" name="setup[inputtype]" value="select" {if condition="$inputtype=='select'"} checked{/if}> 下拉列表框
                <input type="radio" name="setup[inputtype]" value="radio" {if condition="$inputtype=='radio'"} checked{/if}> 单选框
                </td>
            </tr>
            <tr>
                <td>字段类型</td>
                <td>
                    <select name="setup[fieldtype]" class="form-control" onchange="javascript:numbertype(this.value);">
                        <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
                        <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
                        <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
                    </select><span id="numbertype" style="display:none;"> <input type="checkbox" id="" name = "setup[numbertype]" value="1" checked />不包括负数</span>
                </td>
            </tr>
            <tr>
                <td>复选框或单选框时宽度</td>
                <td>
                    <input type="text" class="form-control" size="10" name="setup[labelwidth]" value="{$labelwidth}" /></td>
            </tr>
            <tr>
                <td>顶级类别ID</td>
                <td> <input type="text" class="form-control" size="5"  name="setup[default]" value="{$default}" /></td>
            </tr>
        </table>
    {/case}

    {case value="posid"}

    {/case}

    {case value="radio"}
        <table class="table table-bordered table-sm">
            <tr>
                <td width="120">选项列表:<br>例: <font color="red">选项名称|值</font></td>
                <td><textarea  name="setup[options]" rows="5" cols="40">{if condition="strlen($options)!=5"}{$options}{/if}</textarea></td>
            </tr>
            <tr>
                <td>字段类型</td>
                <td>
                <select name="setup[fieldtype]" onchange="javascript:numbertype(this.value);">
                <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
                <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
                <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
                <option value="mediumint" <?php if($fieldtype=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option>
                <option value="int" <?php if($fieldtype=='int') echo 'selected';?>>整数 INT(10)</option>
                </select>
                    <span id="numbertype" style="display:none;" >
                        <input type="checkbox" name="setup[numbertype]" value="1" checked />不包括负数</span>
                </td>
            </tr>
            <tr>
                <td>宽度</td>
                <td>
                    <input type="text" class="input-text" size="10" name="setup[labelwidth]" value="{$labelwidth}" /></td>
            </tr>
            <tr>
                <td>默认值</td>
                <td> <input type="text" class="input-text" size="5"  name="setup[default]" value="{$default}" /></td>
            </tr>
        </table>
    {/case}

    {case value="checkbox"}
        <table class="table table-bordered table-sm">
            <tr>
                <td width="120">选项列表:<br>例: <font color="red">选项名称|值</font></td>
                <td><textarea  name="setup[options]" rows="5" cols="40">{if condition="strlen($options)!=5"}{$options}{/if}</textarea></td>
            </tr>
            <tr>
                <td>字段类型</td>
                <td>
                    <select name="setup[fieldtype]" onchange="javascript:numbertype(this.value);">
                        <option value="varchar" <?php if($fieldtype=='varchar') echo 'selected';?>>字符 VARCHAR</option>
                        <option value="tinyint" <?php if($fieldtype=='tinyint') echo 'selected';?>>整数 TINYINT(3)</option>
                        <option value="smallint" <?php if($fieldtype=='smallint') echo 'selected';?>>整数 SMALLINT(5)</option>
                        <option value="mediumint" <?php if($fieldtype=='mediumint') echo 'selected';?>>整数 MEDIUMINT(8)</option>
                        <option value="int" <?php if($fieldtype=='int') echo 'selected';?>>整数 INT(10)</option>
                    </select>
                    <span id="numbertype" style="display:none;"  >
                        <input type="checkbox" id="" name = "setup[numbertype]" value="1" checked />不包括负数
                    </span>
                </td>
            </tr>
            <tr>
                <td>宽度</td>
                <td> <input type="text" class="input-text" size="10"  name="setup[labelwidth]" value="{$labelwidth}" /></td>
            </tr>
            <tr>
                <td>默认值</td>
                <td> <input type="text" class="input-text" size="5"  name="setup[default]" value="{$default}" /></td>
            </tr>
        </table>
    {/case}

    {case value="number"}
        <table class="table table-bordered table-sm">
            <tr>
                <td width="120">文本框长度</td>
                <td><input type="text" class="form-control" size="5" name="setup[size]" value="{$size}" /></td>
            </tr>
            <tr>
                <td>是否包括负数：</td>
                <td><input type="checkbox" id="" name = "setup[numbertype]" value="1" checked />不包括负数</td>
            </tr>
            <tr>
                <td>小数位数：</td>
                <td>
                <select name="setup[decimaldigits]">
                <option value="0"<?php if($decimaldigits==0) echo ' selected';?>>0</option>
                <option value="1"<?php if($decimaldigits==1) echo ' selected';?>>1</option>
                <option value="2"<?php if($decimaldigits==2) echo ' selected';?>>2</option>
                <option value="3"<?php if($decimaldigits==3) echo ' selected';?>>3</option>
                <option value="4"<?php if($decimaldigits==4) echo ' selected';?>>4</option>
                <option value="5"<?php if($decimaldigits==5) echo ' selected';?>>5</option>
                </select>
            </td>
            </tr>
            <tr>
                <td>默认值</td>
                <td><input type="text" name="setup[default]" value="{$default}" size="40" class="input-text"></td>
            </tr>
        </table>
    {/case}

    {case value="image"}
        <table class="table table-bordered table-sm">
            <tr>
                <td width="120">文本框长度</td>
                <td><input type="text" name="setup[size]" value="{$size}" size="10" class="input-text"></td>
            </tr>
            <tr>
                <td>默认值</td>
                <td><input type="text" name="setup[default]" value="{$default}" size="40" class="input-text"></td>
            </tr>
            <tr>
                <td>允许上传的文件大小</td>
                <td>
                    <input type="text" name="setup[upload_maxsize]" value="{$upload_maxsize}" size="5" class="input-text">
                </td>
            </tr>
            <tr>
                <td>允许上传的文件类型</td>
                <td><input type="text" name="setup[upload_allowext]" value="<?php if($upload_allowext){echo $upload_allowext;}else{ echo 'jpg,jpeg,gif,png';} ?>" size="40" class="input-text"></td>
            </tr>
            <tr>
                <td>是否添加水印</td>
                <td><input type="radio" name="setup[watermark]" value="1" <?php if($watermark==1) echo 'checked';?>> 是 <input type="radio" name="setup[watermark]" value="0" <?php if($watermark==0) echo 'checked';?>> 否</td>
            </tr>
            <tr>
                <td>是否从已上传中选择</td>
                <td><input type="radio" name="setup[more]" value="1" <?php if($more==1) echo 'checked';?>> 是 <input type="radio" name="setup[more]" value="0" <?php if($more==0) echo 'checked';?>> 否</td>
            </tr>
        </table>
    {/case}
    {case value="images"}
        <table class="table table-bordered table-sm">
            <tr>
                <td>默认值</td>
                <td><input type="text" name="setup[default]" value="{$default}" size="40" class="input-text"></td>
            </tr>
            <tr>
                <td>最多允许上传几张图片</td>
                <td><input type="text" name="setup[upload_maxnum]" value="{$upload_maxnum}" size="5" class="input-text"></td>
            </tr>
            <tr>
                <td>允许上传的图片大小</td>
                <td><input type="text" name="setup[upload_maxsize]" value="{$upload_maxsize}" size="5" class="input-text">
                </td>
            </tr>
            <tr>
                <td>允许上传的图片类型</td>
                <td><input type="text" name="setup[upload_allowext]" value="<?php if($upload_allowext){echo $upload_allowext;}else{ echo 'jpg,jpeg,gif,png';} ?>" size="40" class="input-text"></td>
            </tr>
            <tr>
                <td>是否在图片上添加水印</td>
                <td><input type="radio" name="setup[watermark]" value="1" <?php if($watermark==1) echo 'checked';?>> 是 <input type="radio" name="setup[watermark]" value="0" <?php if($watermark==0) echo 'checked';?>> 否</td>
            </tr>
            <tr>
                <td>是否从已上传中选择</td>
                <td><input type="radio" name="setup[more]" value="1" <?php if($more==1) echo 'checked';?>> 是 <input type="radio" name="setup[more]" value="0" <?php if($more==0) echo 'checked';?>> 否</td>
            </tr>
        </table>
    {/case}
    {case value="file"}
        <table class="table table-bordered table-sm">
            <tr>
                <td class="w-200">文本框长度</td>
                <td>
                    <input type="text" name="setup[size]" value="{$size}" size="10" class="form-control">
                </td>
            </tr>
            <tr>
                <td>默认值</td>
                <td>
                    <input type="text" name="setup[default]" value="{$default}" class="form-control w-100px">
                </td>
            </tr>
            <tr>
                <td>允许上传的文件大小</td>
                <td>
                    <input type="text" name="setup[upload_maxsize]" value="{$upload_maxsize}" size="5" class="form-control w-100px">字节
                </td>
            </tr>
            <tr>
                <td>允许上传的文件类型</td>
                <td><input type="text" name="setup[upload_allowext]" value="<?php if($upload_allowext){echo $upload_allowext;}else{ echo 'zip,rar,doc,ppt';} ?>" size="40" class="form-control">
                </td>
            </tr>
            <tr>
                <td>是否从已上传中选择</td>
                <td><input type="radio" name="setup[more]" value="1" <?php if($more==1) echo 'checked';?>> 是 <input type="radio" name="setup[more]" value="0" <?php if($more==0) echo 'checked';?>> 否</td>
            </tr>
        </table>
    {/case}
    {case value="files"}
        <table class="table table-bordered table-sm">
            <tr>
                <td>默认值</td>
                <td><input type="text" name="setup[default]" value="{$default}" size="40" class="input-text"></td>
            </tr>
            <tr>
                <td>最多允许上传的文件个数</td>
                <td><input type="text" name="setup[upload_maxnum]" value="{$upload_maxnum}" size="5" class="input-text"></td>
            </tr>
            <tr>
                <td>允许上传的文件大小</td>
                <td>
                    <input type="text" name="setup[upload_maxsize]" value="{$upload_maxsize}" size="5" class="input-text">字节
                </td>
            </tr>
            <tr>
                <td>允许上传的文件类型</td>
                <td>
                    <input type="text" name="setup[upload_allowext]" value="<?php if($upload_allowext){echo $upload_allowext;}else{ echo 'zip,rar,doc,ppt';} ?>" size="40" class="input-text">
                </td>
            </tr>
            <tr>
                <td>是否从已上传中选择</td>
                <td><input type="radio" name="setup[more]" value="1" <?php if($more==1) echo 'checked';?>> 是
                    <input type="radio" name="setup[more]" value="0" <?php if($more==0) echo 'checked';?>> 否
                </td>
            </tr>
        </table>
    {/case}
    {case value="verify"}
         <table class="table table-bordered table-condensed">
            <tr>
                <td width="120">文本框长度</td>
                <td><input type="text" class="input-text" size="5" name="setup[size]" value="{$size}" /></td>
            </tr>
        </table>
    {/case}

    {default /}
{/switch}

<script>
    function numbertype(fieldtype){

        if(fieldtype === 'varchar'){
            $('#numbertype').hide();
        }else{
            $('#numbertype').show();
        }
    }
    {if condition="!empty($fieldtype) && $fieldtype!='varchar'"}
    $('#numbertype').show();
    {/if}
</script>
